package com.itany.shop.controller;

import java.util.Scanner;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class MainController {
    private Scanner sc = new Scanner(System.in);
    public void showMenu() {
        System.out.println("*********************欢迎xxx成功进入紫金商城主页*********************");
        System.out.print("请选择服务(1.加入购物车 2.查看购物车 3.我的订单 4.修改密码 5.退出登录):");
        int choice = sc.nextInt();
        switch (choice) {
            case 1:
                addCart();
                break;
            case 2:
                showCart();
                break;
            case 3:
                findMyOrders();
                break;
            case 4:
                modifyPassword();
                break;
            case 5:
                System.out.println("提示:您已经退出登录!");
                new StartController().showMenu();
                break;
            default:
                System.out.println("错误:对不起,您输入的选项有误,请重新输入");
                break;
        }
    }

    public void addCart() {
        showMenu();
    }

    public void showCart() {
        // 查看购物车业务功能

        // 二级菜单
        System.out.print("请选择服务(1.删除指定商品 2.修改商品数量 3.清空购物车 4.结算 5.回到主菜单):");
        int choice = sc.nextInt();
        switch (choice) {
            case 1:

        }

        showMenu();
    }

    public void findMyOrders() {
        showMenu();
    }

    public void modifyPassword() {
        showMenu();
    }
}
